@use '../../internals/Box/styles/index' as box;
@use '../../styles/mixins/listbox' as listbox;
@use '../../styles/mixins/combobox' as combobox;
@use './search';

// CascadeTree
// ----------------------

.rs-cascade-tree {
  .rs-highlight-mark {
    padding: 0;
  }
}

// Menu Items
.rs-cascade-tree-items {
  padding: 6px 0;
  display: flex;

  ul,
  li {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--rs-font-size-sm);
  }
}

// Column
.rs-cascade-tree-column {
  overflow-y: auto;
  overflow-x: hidden;

  &-loading {
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;

    .rs-icon {
      margin: 4px;
    }
  }
}

// Tree item
.rs-cascade-tree-item {
  @include listbox.listbox-option;

  position: relative;
  word-break: break-word;

  &:hover,
  &:focus,
  &.rs-cascade-tree-item-focus {
    @include listbox.listbox-option-active;
  }

  &.rs-cascade-tree-item-active {
    @include listbox.listbox-option-selected;

    .rs-cascade-tree-caret {
      color: var(--rs-text-primary);
    }
  }

  &:disabled,
  &.rs-cascade-tree-item-disabled {
    @include listbox.listbox-options-disabled;
  }

  &-label {
    display: inline-flex;
    align-items: center;
    gap: var(--rs-spacing);
  }
}

.rs-cascade-tree-caret {
  @include combobox.combobox-indicator-icon;

  font-size: var(--rs-font-size-sm);
}
